package com.boonya.rmi.order.service;

import com.boonya.rmi.order.dao.OrderRepository;
import com.boonya.rmi.order.entity.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * @ClassName: OrderManager
 * @Description: TODO(订单接口实现)
 * @author: pengjunlin
 * @motto: 学习需要毅力，那就秀毅力
 * @date 2021/4/21 15:48
 */
@Service
public class OrderManager extends UnicastRemoteObject implements IOrder {

    @Autowired
    OrderRepository orderRepository;

    /**
     * 构造函数抛出异常
     *
     * @throws RemoteException
     */
    public OrderManager() throws RemoteException {
        super();
    }

    @Override
    public Order getOrder(Integer id) throws RemoteException {
        return orderRepository.getOne(id);
    }
}
